package com.gaohe.post.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.post.mapper.FmPostTopMapper;
import com.gaohe.post.domain.FmPostTop;
import com.gaohe.post.service.IFmPostTopService;

/**
 * 帖子置顶记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmPostTopServiceImpl implements IFmPostTopService 
{
    @Autowired
    private FmPostTopMapper fmPostTopMapper;

    /**
     * 查询帖子置顶记录
     * 
     * @param postTopId 帖子置顶记录主键
     * @return 帖子置顶记录
     */
    @Override
    public FmPostTop selectFmPostTopByPostTopId(Long postTopId)
    {
        return fmPostTopMapper.selectFmPostTopByPostTopId(postTopId);
    }

    /**
     * 查询帖子置顶记录列表
     * 
     * @param fmPostTop 帖子置顶记录
     * @return 帖子置顶记录
     */
    @Override
    public List<FmPostTop> selectFmPostTopList(FmPostTop fmPostTop)
    {
        return fmPostTopMapper.selectFmPostTopList(fmPostTop);
    }

    /**
     * 新增帖子置顶记录
     * 
     * @param fmPostTop 帖子置顶记录
     * @return 结果
     */
    @Override
    public int insertFmPostTop(FmPostTop fmPostTop)
    {
        fmPostTop.setCreateTime(DateUtils.getNowDate());
        return fmPostTopMapper.insertFmPostTop(fmPostTop);
    }

    /**
     * 修改帖子置顶记录
     * 
     * @param fmPostTop 帖子置顶记录
     * @return 结果
     */
    @Override
    public int updateFmPostTop(FmPostTop fmPostTop)
    {
        fmPostTop.setUpdateTime(DateUtils.getNowDate());
        return fmPostTopMapper.updateFmPostTop(fmPostTop);
    }

    /**
     * 批量删除帖子置顶记录
     * 
     * @param postTopIds 需要删除的帖子置顶记录主键
     * @return 结果
     */
    @Override
    public int deleteFmPostTopByPostTopIds(Long[] postTopIds)
    {
        return fmPostTopMapper.deleteFmPostTopByPostTopIds(postTopIds);
    }

    /**
     * 删除帖子置顶记录信息
     * 
     * @param postTopId 帖子置顶记录主键
     * @return 结果
     */
    @Override
    public int deleteFmPostTopByPostTopId(Long postTopId)
    {
        return fmPostTopMapper.deleteFmPostTopByPostTopId(postTopId);
    }
}
